<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of searchRegistry_gui</title>
  <meta name="keywords" content="searchRegistry_gui">
  <meta name="description" content="SEARCHREGISTRY_GUI is the GUI for DAS Registry search in Browser">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt;  <a href="index.html">code</a> &gt; searchRegistry_gui.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for code&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->

<h1>searchRegistry_gui
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>SEARCHREGISTRY_GUI is the GUI for DAS Registry search in Browser</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function varargout = searchRegistry_gui(varargin) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> SEARCHREGISTRY_GUI is the GUI for DAS Registry search in Browser
      SEARCHREGISTRY_GUI, by itself, creates a new SEARCHREGISTRY_GUI or raises the existing
      singleton*.

      H = SEARCHREGISTRY_GUI returns the handle to a new SEARCHREGISTRY_GUI or the handle to
      the existing singleton*.

      SEARCHREGISTRY_GUI('CALLBACK',hObject,eventData,handles,...) calls the local
      function named CALLBACK in SEARCHREGISTRY_GUI.M with the given input arguments.

      SEARCHREGISTRY_GUI('Property','Value',...) creates a new SEARCHREGISTRY_GUI or raises the
      existing singleton*.  Starting from the left, property value pairs are
      applied to the GUI before searchRegistry_gui_OpeningFunction gets called.  An
      unrecognized property name or invalid value makes property application
      stop.  All inputs are passed to searchRegistry_gui_OpeningFcn via varargin.

      *See GUI Options on GUIDE's Tools menu.  Choose &quot;GUI allows only one
      instance to run (singleton)&quot;.

 See also: <a href="das_gui.html" class="code" title="function varargout = das_gui(varargin)">DAS_GUI</a>

    DASMiner: DAS library and browser for Matlab.
    Diogo Veiga, March 2008.</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="addNewServer.html" class="code" title="function [status] = addNewServer(uri,msgBox)">addNewServer</a>	ADDNEWSERVER adds a new DAS service for browsing within the browser</li><li><a href="checkDASResponse.html" class="code" title="function [isOkay] = checkDASResponse(xmlS,status)">checkDASResponse</a>	CHECKDASRESPONSE used by DASMiner Browser to create a message box about the status of a DAS query</li><li><a href="createTableResults.html" class="code" title="function [tab]= createTableResults(dasXML,parentFig)">createTableResults</a>	CREATETABLERESULTS creates a JTable with the results of searching in DAS Registry</li><li><a href="getDASRegistryOptions.html" class="code" title="function [optList] = getDASRegistryOptions(varargin)">getDASRegistryOptions</a>	GETDASREGISTRYOPTIONS extract the list of search options in DAS Registry</li><li><a href="populateServerMenu.html" class="code" title="function populateServerMenu(hServerMenu)">populateServerMenu</a>	POPULATESERVERMENU reads available DAS services for browsing in DASMiner</li><li><a href="searchDASRegistry.html" class="code" title="function [xmlStruct, xml,status] = searchDASRegistry(varargin)">searchDASRegistry</a>	SEARCHDASREGISTRY executes the specified query to interact with DAS Registry</li><li><a href="showinfowindow.html" class="code" title="function f = showinfowindow(msg,wtitle,handleDispGUI)">showinfowindow</a>	SHOWINFOWINDOW creates a small dialog window which displays a user-defined message.</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="das_gui.html" class="code" title="function varargout = das_gui(varargin)">das_gui</a>	DAS_GUI main GUI of DASMiner Browser</li></ul>
<!-- crossreference -->

<h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="#_sub1" class="code">function searchRegistry_gui_OpeningFcn(hObject, eventdata, handles, varargin)</a></li><li><a href="#_sub2" class="code">function varargout = searchRegistry_gui_OutputFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub3" class="code">function radiobutton1_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub4" class="code">function radiobutton2_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub5" class="code">function popupmenu_SearchCrit_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub6" class="code">function popupmenu_SearchCrit_CreateFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub7" class="code">function popupmenu_SearchType_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub8" class="code">function popupmenu_SearchType_CreateFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub9" class="code">function popupmenu_OptionsSearch_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub10" class="code">function popupmenu_OptionsSearch_CreateFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub11" class="code">function pushbutton_FindRegistry_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub12" class="code">function pushbutton_NewSrch_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub13" class="code">function pushbutton_addSource_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub14" class="code">function popupmenu4_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub15" class="code">function popupmenu4_CreateFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub16" class="code">function deleteTableResults(hObject,handles)</a></li><li><a href="#_sub17" class="code">function resetSearchMenus(handles)</a></li><li><a href="#_sub18" class="code">function [hDial] = openRunningDialog(hDisplay)</a></li><li><a href="#_sub19" class="code">function field_labelSearch_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub20" class="code">function field_labelSearch_CreateFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub21" class="code">function myResizeFcn(hObject,handles)</a></li><li><a href="#_sub22" class="code">function uipanel_SearchRegistry_ResizeFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub23" class="code">function drawResultsTable(handles)</a></li><li><a href="#_sub24" class="code">function pushbutton_FindRegistry_CreateFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub25" class="code">function pushbutton_NewSrch_CreateFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub26" class="code">function pushbutton_addSource_CreateFcn(hObject, eventdata, handles)</a></li></ul>
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function varargout = searchRegistry_gui(varargin)</a>
0002 <span class="comment">% SEARCHREGISTRY_GUI is the GUI for DAS Registry search in Browser</span>
0003 <span class="comment">%      SEARCHREGISTRY_GUI, by itself, creates a new SEARCHREGISTRY_GUI or raises the existing</span>
0004 <span class="comment">%      singleton*.</span>
0005 <span class="comment">%</span>
0006 <span class="comment">%      H = SEARCHREGISTRY_GUI returns the handle to a new SEARCHREGISTRY_GUI or the handle to</span>
0007 <span class="comment">%      the existing singleton*.</span>
0008 <span class="comment">%</span>
0009 <span class="comment">%      SEARCHREGISTRY_GUI('CALLBACK',hObject,eventData,handles,...) calls the local</span>
0010 <span class="comment">%      function named CALLBACK in SEARCHREGISTRY_GUI.M with the given input arguments.</span>
0011 <span class="comment">%</span>
0012 <span class="comment">%      SEARCHREGISTRY_GUI('Property','Value',...) creates a new SEARCHREGISTRY_GUI or raises the</span>
0013 <span class="comment">%      existing singleton*.  Starting from the left, property value pairs are</span>
0014 <span class="comment">%      applied to the GUI before searchRegistry_gui_OpeningFunction gets called.  An</span>
0015 <span class="comment">%      unrecognized property name or invalid value makes property application</span>
0016 <span class="comment">%      stop.  All inputs are passed to searchRegistry_gui_OpeningFcn via varargin.</span>
0017 <span class="comment">%</span>
0018 <span class="comment">%      *See GUI Options on GUIDE's Tools menu.  Choose &quot;GUI allows only one</span>
0019 <span class="comment">%      instance to run (singleton)&quot;.</span>
0020 <span class="comment">%</span>
0021 <span class="comment">% See also: DAS_GUI</span>
0022 <span class="comment">%</span>
0023 <span class="comment">%    DASMiner: DAS library and browser for Matlab.</span>
0024 <span class="comment">%    Diogo Veiga, March 2008.</span>
0025 
0026 
0027 <span class="comment">% Begin initialization code - DO NOT EDIT</span>
0028 gui_Singleton = 1;
0029 gui_State = struct(<span class="string">'gui_Name'</span>,       mfilename, <span class="keyword">...</span>
0030                    <span class="string">'gui_Singleton'</span>,  gui_Singleton, <span class="keyword">...</span>
0031                    <span class="string">'gui_OpeningFcn'</span>, @<a href="#_sub1" class="code" title="subfunction searchRegistry_gui_OpeningFcn(hObject, eventdata, handles, varargin)">searchRegistry_gui_OpeningFcn</a>, <span class="keyword">...</span>
0032                    <span class="string">'gui_OutputFcn'</span>,  @<a href="#_sub2" class="code" title="subfunction varargout = searchRegistry_gui_OutputFcn(hObject, eventdata, handles)">searchRegistry_gui_OutputFcn</a>, <span class="keyword">...</span>
0033                    <span class="string">'gui_LayoutFcn'</span>,  [] , <span class="keyword">...</span>
0034                    <span class="string">'gui_Callback'</span>,   []);
0035 <span class="keyword">if</span> nargin &amp;&amp; ischar(varargin{1})
0036     gui_State.gui_Callback = str2func(varargin{1});
0037 <span class="keyword">end</span>
0038 
0039 <span class="keyword">if</span> nargout
0040     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0041 <span class="keyword">else</span>
0042     gui_mainfcn(gui_State, varargin{:});
0043 <span class="keyword">end</span>
0044 <span class="comment">% End initialization code - DO NOT EDIT</span>
0045 
0046 
0047 <span class="comment">% --- Executes just before searchRegistry_gui is made visible.</span>
0048 <a name="_sub1" href="#_subfunctions" class="code">function searchRegistry_gui_OpeningFcn(hObject, eventdata, handles, varargin)</a>
0049 <span class="comment">% This function has no output args, see OutputFcn.</span>
0050 <span class="comment">% hObject    handle to figure</span>
0051 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0052 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0053 <span class="comment">% varargin   command line arguments to searchRegistry_gui (see VARARGIN)</span>
0054 
0055 <span class="comment">% Choose default command line output for searchRegistry_gui</span>
0056 handles.output = hObject;
0057 
0058 handles.popupmenu_Server = varargin{1};
0059 
0060 <span class="comment">% Update handles structure</span>
0061 guidata(hObject, handles);
0062 
0063 <span class="comment">% UIWAIT makes searchRegistry_gui wait for user response (see UIRESUME)</span>
0064 <span class="comment">% uiwait(handles.figure1);</span>
0065 
0066 
0067 <span class="comment">% --- Outputs from this function are returned to the command line.</span>
0068 <a name="_sub2" href="#_subfunctions" class="code">function varargout = searchRegistry_gui_OutputFcn(hObject, eventdata, handles) </a>
0069 <span class="comment">% varargout  cell array for returning output args (see VARARGOUT);</span>
0070 <span class="comment">% hObject    handle to figure</span>
0071 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0072 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0073 
0074 <span class="comment">% Get default command line output from handles structure</span>
0075 varargout{1} = handles.output;
0076 
0077 
0078 <span class="comment">% --- Executes on button press in radiobutton1.</span>
0079 <a name="_sub3" href="#_subfunctions" class="code">function radiobutton1_Callback(hObject, eventdata, handles)</a>
0080 <span class="comment">% hObject    handle to radiobutton1 (see GCBO)</span>
0081 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0082 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0083 
0084 <span class="comment">% Hint: get(hObject,'Value') returns toggle state of radiobutton1</span>
0085 
0086 
0087 <span class="comment">% --- Executes on button press in radiobutton2.</span>
0088 <a name="_sub4" href="#_subfunctions" class="code">function radiobutton2_Callback(hObject, eventdata, handles)</a>
0089 <span class="comment">% hObject    handle to radiobutton2 (see GCBO)</span>
0090 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0091 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0092 
0093 <span class="comment">% Hint: get(hObject,'Value') returns toggle state of radiobutton2</span>
0094 
0095 
0096 <span class="comment">% --- Executes on selection change in popupmenu_SearchCrit.</span>
0097 <a name="_sub5" href="#_subfunctions" class="code">function popupmenu_SearchCrit_Callback(hObject, eventdata, handles)</a>
0098 <span class="comment">% hObject    handle to popupmenu_SearchCrit (see GCBO)</span>
0099 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0100 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0101 
0102 <span class="comment">% Hints: contents = get(hObject,'String') returns popupmenu_SearchCrit contents as cell array</span>
0103 <span class="comment">%        contents{get(hObject,'Value')} returns selected item from popupmenu_SearchCrit</span>
0104 <a href="#_sub16" class="code" title="subfunction deleteTableResults(hObject,handles)">deleteTableResults</a>(hObject,handles);
0105 set(handles.popupmenu_OptionsSearch,<span class="string">'String'</span>,<span class="string">''</span>);
0106 set(handles.popupmenu_OptionsSearch,<span class="string">'Visible'</span>,<span class="string">'off'</span>);
0107 
0108 <span class="keyword">if</span> (get(hObject,<span class="string">'Value'</span>) == 2) 
0109     hDial = <a href="#_sub18" class="code" title="subfunction [hDial] = openRunningDialog(hDisplay)">openRunningDialog</a>(handles.figure_DASdiscovery);
0110     list = <a href="getDASRegistryOptions.html" class="code" title="function [optList] = getDASRegistryOptions(varargin)">getDASRegistryOptions</a>(<span class="string">'criteria'</span>,<span class="string">'organism'</span>);
0111     delete(hDial);
0112     clear hDial;
0113 
0114     <span class="keyword">if</span> (~iscellstr(list))
0115         <span class="keyword">return</span>;
0116     <span class="keyword">end</span>
0117 <span class="keyword">elseif</span> (get(hObject,<span class="string">'Value'</span>) == 3) 
0118     hDial = <a href="#_sub18" class="code" title="subfunction [hDial] = openRunningDialog(hDisplay)">openRunningDialog</a>(handles.figure_DASdiscovery);
0119     list = <a href="getDASRegistryOptions.html" class="code" title="function [optList] = getDASRegistryOptions(varargin)">getDASRegistryOptions</a>(<span class="string">'criteria'</span>,<span class="string">'type'</span>);
0120     delete(hDial);
0121     clear hDial;
0122 
0123     <span class="keyword">if</span> (~iscellstr(list))
0124         <span class="keyword">return</span>;
0125     <span class="keyword">end</span>
0126 <span class="keyword">elseif</span> (get(hObject,<span class="string">'Value'</span>) == 4) 
0127     hDial = <a href="#_sub18" class="code" title="subfunction [hDial] = openRunningDialog(hDisplay)">openRunningDialog</a>(handles.figure_DASdiscovery);
0128     list = <a href="getDASRegistryOptions.html" class="code" title="function [optList] = getDASRegistryOptions(varargin)">getDASRegistryOptions</a>(<span class="string">'criteria'</span>,<span class="string">'authority'</span>);
0129     delete(hDial);
0130     clear hDial;
0131 
0132     <span class="keyword">if</span> (~iscellstr(list))
0133         <span class="keyword">return</span>;
0134     <span class="keyword">end</span>
0135     
0136 <span class="keyword">elseif</span> (get(hObject,<span class="string">'Value'</span>) == 5) 
0137     hDial = <a href="#_sub18" class="code" title="subfunction [hDial] = openRunningDialog(hDisplay)">openRunningDialog</a>(handles.figure_DASdiscovery);
0138     list = <a href="getDASRegistryOptions.html" class="code" title="function [optList] = getDASRegistryOptions(varargin)">getDASRegistryOptions</a>(<span class="string">'criteria'</span>,<span class="string">'capability'</span>);
0139     delete(hDial);
0140     clear hDial;
0141 
0142     <span class="keyword">if</span> (~iscellstr(list))
0143         <span class="keyword">return</span>;
0144     <span class="keyword">end</span>
0145 
0146 <span class="keyword">end</span>
0147 
0148 <span class="keyword">if</span> ( (1 &lt; get(hObject,<span class="string">'Value'</span>)) &amp;&amp;  (get(hObject,<span class="string">'Value'</span>) &lt; 6) ) 
0149     set(handles.field_labelSearch,<span class="string">'Visible'</span>,<span class="string">'off'</span>);
0150     set(handles.field_labelSearch,<span class="string">'String'</span>,<span class="string">''</span>);
0151     set(handles.popupmenu_OptionsSearch,<span class="string">'String'</span>,list);
0152     set(handles.popupmenu_OptionsSearch,<span class="string">'Visible'</span>,<span class="string">'on'</span>);
0153     
0154 
0155 <span class="keyword">elseif</span> (get(hObject,<span class="string">'Value'</span>) == 6)
0156     set(handles.field_labelSearch,<span class="string">'Visible'</span>,<span class="string">'on'</span>);
0157     set(handles.popupmenu_OptionsSearch,<span class="string">'Visible'</span>,<span class="string">'off'</span>);
0158 <span class="keyword">end</span>
0159     set(handles.pushbutton_FindRegistry,<span class="string">'Visible'</span>,<span class="string">'on'</span>);
0160 
0161 
0162 
0163 
0164 
0165 <span class="comment">% --- Executes during object creation, after setting all properties.</span>
0166 <a name="_sub6" href="#_subfunctions" class="code">function popupmenu_SearchCrit_CreateFcn(hObject, eventdata, handles)</a>
0167 <span class="comment">% hObject    handle to popupmenu_SearchCrit (see GCBO)</span>
0168 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0169 <span class="comment">% handles    empty - handles not created until after all CreateFcns called</span>
0170 
0171 <span class="comment">% Hint: popupmenu controls usually have a white background on Windows.</span>
0172 <span class="comment">%       See ISPC and COMPUTER.</span>
0173 <span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))
0174     set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);
0175 <span class="keyword">end</span>
0176 
0177 
0178 <span class="comment">% --- Executes on selection change in popupmenu_SearchType.</span>
0179 <a name="_sub7" href="#_subfunctions" class="code">function popupmenu_SearchType_Callback(hObject, eventdata, handles)</a>
0180 <span class="comment">% hObject    handle to popupmenu_SearchType (see GCBO)</span>
0181 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0182 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0183 
0184 <span class="comment">% Hints: contents = get(hObject,'String') returns popupmenu_SearchType contents as cell array</span>
0185 <span class="comment">%        contents{get(hObject,'Value')} returns selected item from popupmenu_SearchType</span>
0186 
0187 <a href="#_sub16" class="code" title="subfunction deleteTableResults(hObject,handles)">deleteTableResults</a>(hObject,handles);
0188 <span class="keyword">if</span> (get(hObject,<span class="string">'Value'</span>) == 1)
0189     <a href="#_sub17" class="code" title="subfunction resetSearchMenus(handles)">resetSearchMenus</a>(handles);
0190     <a href="#_sub16" class="code" title="subfunction deleteTableResults(hObject,handles)">deleteTableResults</a>(hObject,handles);
0191 <span class="keyword">elseif</span> (get(hObject,<span class="string">'Value'</span>) == 2)
0192     <a href="#_sub17" class="code" title="subfunction resetSearchMenus(handles)">resetSearchMenus</a>(handles);
0193     set(handles.popupmenu_SearchCrit,<span class="string">'Value'</span>,1);
0194     set(handles.popupmenu_SearchCrit,<span class="string">'Visible'</span>,<span class="string">'on'</span>);
0195 <span class="keyword">elseif</span> (get(hObject,<span class="string">'Value'</span>) == 3)
0196     <a href="#_sub17" class="code" title="subfunction resetSearchMenus(handles)">resetSearchMenus</a>(handles);
0197     set(handles.pushbutton_FindRegistry,<span class="string">'Visible'</span>,<span class="string">'on'</span>);
0198 <span class="keyword">end</span>
0199     
0200 
0201 <span class="comment">% --- Executes during object creation, after setting all properties.</span>
0202 <a name="_sub8" href="#_subfunctions" class="code">function popupmenu_SearchType_CreateFcn(hObject, eventdata, handles)</a>
0203 <span class="comment">% hObject    handle to popupmenu_SearchType (see GCBO)</span>
0204 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0205 <span class="comment">% handles    empty - handles not created until after all CreateFcns called</span>
0206 
0207 <span class="comment">% Hint: popupmenu controls usually have a white background on Windows.</span>
0208 <span class="comment">%       See ISPC and COMPUTER.</span>
0209 <span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))
0210     set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);
0211 <span class="keyword">end</span>
0212 
0213 
0214 <span class="comment">% --- Executes on selection change in popupmenu_OptionsSearch.</span>
0215 <a name="_sub9" href="#_subfunctions" class="code">function popupmenu_OptionsSearch_Callback(hObject, eventdata, handles)</a>
0216 <span class="comment">% hObject    handle to popupmenu_OptionsSearch (see GCBO)</span>
0217 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0218 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0219 
0220 <span class="comment">% Hints: contents = get(hObject,'String') returns popupmenu_OptionsSearch contents as cell array</span>
0221 <span class="comment">%        contents{get(hObject,'Value')} returns selected item from popupmenu_OptionsSearch</span>
0222 <a href="#_sub16" class="code" title="subfunction deleteTableResults(hObject,handles)">deleteTableResults</a>(hObject,handles);
0223 
0224 <span class="comment">% --- Executes during object creation, after setting all properties.</span>
0225 <a name="_sub10" href="#_subfunctions" class="code">function popupmenu_OptionsSearch_CreateFcn(hObject, eventdata, handles)</a>
0226 <span class="comment">% hObject    handle to popupmenu_OptionsSearch (see GCBO)</span>
0227 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0228 <span class="comment">% handles    empty - handles not created until after all CreateFcns called</span>
0229 
0230 <span class="comment">% Hint: popupmenu controls usually have a white background on Windows.</span>
0231 <span class="comment">%       See ISPC and COMPUTER.</span>
0232 <span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))
0233     set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);
0234 <span class="keyword">end</span>
0235 
0236 
0237 <span class="comment">% --- Executes on button press in pushbutton_FindRegistry.</span>
0238 <a name="_sub11" href="#_subfunctions" class="code">function pushbutton_FindRegistry_Callback(hObject, eventdata, handles)</a>
0239 <span class="comment">% hObject    handle to pushbutton_FindRegistry (see GCBO)</span>
0240 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0241 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0242 
0243 <a href="#_sub16" class="code" title="subfunction deleteTableResults(hObject,handles)">deleteTableResults</a>(hObject,handles);
0244 <span class="keyword">switch</span> get(handles.popupmenu_SearchType,<span class="string">'Value'</span>)
0245     
0246     <span class="keyword">case</span> 1
0247         <a href="#_sub17" class="code" title="subfunction resetSearchMenus(handles)">resetSearchMenus</a>;
0248     <span class="keyword">case</span> 2
0249         
0250         <span class="keyword">if</span> (get(handles.popupmenu_SearchCrit,<span class="string">'Value'</span>) &lt;6)
0251             contents = get(handles.popupmenu_OptionsSearch,<span class="string">'String'</span>);
0252             opt = contents{get(handles.popupmenu_OptionsSearch,<span class="string">'Value'</span>)};
0253         <span class="keyword">end</span>
0254         
0255         hDial = <a href="#_sub18" class="code" title="subfunction [hDial] = openRunningDialog(hDisplay)">openRunningDialog</a>(handles.figure_DASdiscovery);
0256         
0257         <span class="keyword">switch</span> get(handles.popupmenu_SearchCrit,<span class="string">'Value'</span>)
0258             
0259             <span class="keyword">case</span> 2 
0260                 [xmlS, xml, status] = <a href="searchDASRegistry.html" class="code" title="function [xmlStruct, xml,status] = searchDASRegistry(varargin)">searchDASRegistry</a>(<span class="string">'organism'</span>,opt);
0261             <span class="keyword">case</span> 3 
0262                 [xmlS, xml, status] = <a href="searchDASRegistry.html" class="code" title="function [xmlStruct, xml,status] = searchDASRegistry(varargin)">searchDASRegistry</a>(<span class="string">'type'</span>,opt);
0263             <span class="keyword">case</span> 4 
0264                 [xmlS, xml, status] = <a href="searchDASRegistry.html" class="code" title="function [xmlStruct, xml,status] = searchDASRegistry(varargin)">searchDASRegistry</a>(<span class="string">'authority'</span>,opt);
0265             <span class="keyword">case</span> 5 
0266                 [xmlS, xml, status] = <a href="searchDASRegistry.html" class="code" title="function [xmlStruct, xml,status] = searchDASRegistry(varargin)">searchDASRegistry</a>(<span class="string">'capability'</span>,opt);
0267             <span class="keyword">case</span> 6
0268                 
0269                 <span class="keyword">if</span> (isempty(get(handles.field_labelSearch,<span class="string">'String'</span>)))
0270                     msgbox(<span class="string">'Enter the label for the search.'</span>,<span class="string">'Input Requested'</span>,<span class="string">'warn'</span>);
0271                     <span class="keyword">return</span>;
0272                 <span class="keyword">else</span>
0273                     [xmlS, xml, status] = <a href="searchDASRegistry.html" class="code" title="function [xmlStruct, xml,status] = searchDASRegistry(varargin)">searchDASRegistry</a>(<span class="string">'label'</span>,get(handles.field_labelSearch,<span class="string">'String'</span>) );
0274                 <span class="keyword">end</span>
0275                 
0276                 
0277         <span class="keyword">end</span>
0278         delete(hDial);
0279         clear hDial;
0280 
0281         <span class="keyword">if</span> (~<a href="checkDASResponse.html" class="code" title="function [isOkay] = checkDASResponse(xmlS,status)">checkDASResponse</a>(xmlS,status))
0282             <span class="keyword">return</span>;
0283         <span class="keyword">end</span>
0284 
0285         tab = <a href="createTableResults.html" class="code" title="function [tab]= createTableResults(dasXML,parentFig)">createTableResults</a>(xml,handles.figure_DASdiscovery);
0286         
0287         <span class="keyword">if</span> (~(tab == -1))
0288             handles.tab = tab;
0289             guidata(hObject,handles);
0290             <a href="#_sub23" class="code" title="subfunction drawResultsTable(handles)">drawResultsTable</a>(handles);
0291         <span class="keyword">end</span>
0292             
0293         
0294     <span class="keyword">case</span> 3
0295         hDial = <a href="#_sub18" class="code" title="subfunction [hDial] = openRunningDialog(hDisplay)">openRunningDialog</a>(handles.figure_DASdiscovery);
0296         [xmlS, xml, status] = <a href="searchDASRegistry.html" class="code" title="function [xmlStruct, xml,status] = searchDASRegistry(varargin)">searchDASRegistry</a>;
0297         delete(hDial);
0298         clear hDial;
0299 
0300         <span class="keyword">if</span> (~<a href="checkDASResponse.html" class="code" title="function [isOkay] = checkDASResponse(xmlS,status)">checkDASResponse</a>(xmlS,status))
0301             <span class="keyword">return</span>;
0302         <span class="keyword">end</span>
0303         
0304         tab = <a href="createTableResults.html" class="code" title="function [tab]= createTableResults(dasXML,parentFig)">createTableResults</a>(xml,handles.figure_DASdiscovery);
0305         
0306         <span class="keyword">if</span> (~(tab == -1))
0307             handles.tab = tab;
0308             guidata(hObject,handles);
0309             <a href="#_sub23" class="code" title="subfunction drawResultsTable(handles)">drawResultsTable</a>(handles);
0310         <span class="keyword">end</span>
0311 <span class="keyword">end</span>
0312 
0313 <span class="comment">% --- Executes on button press in pushbutton_FindRegistry.</span>
0314 <a name="_sub12" href="#_subfunctions" class="code">function pushbutton_NewSrch_Callback(hObject, eventdata, handles)</a>
0315 <span class="comment">% hObject    handle to pushbutton_FindRegistry (see GCBO)</span>
0316 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0317 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0318 <a href="#_sub16" class="code" title="subfunction deleteTableResults(hObject,handles)">deleteTableResults</a>(hObject,handles);
0319 <a href="#_sub17" class="code" title="subfunction resetSearchMenus(handles)">resetSearchMenus</a>(handles);
0320 set(handles.popupmenu_SearchType,<span class="string">'Value'</span>,1);
0321 
0322 <span class="comment">% --- Executes on button press in pushbutton_FindRegistry.</span>
0323 <a name="_sub13" href="#_subfunctions" class="code">function pushbutton_addSource_Callback(hObject, eventdata, handles)</a>
0324 <span class="comment">% hObject    handle to pushbutton_addSource (see GCBO)</span>
0325 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0326 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0327 jt = handles.tab.getTable;
0328 row = jt.getSelectedRows;
0329 
0330 <span class="keyword">if</span> (size(row,1) &gt; 1)
0331     msgbox(<span class="string">'Please select one DAS service at a time.'</span>,<span class="string">'DAS Registry Discovery'</span>,<span class="string">'warn'</span>);
0332     <span class="keyword">return</span>;
0333 <span class="keyword">end</span>
0334 
0335 selection = questdlg(<span class="string">'Do you want to add the selected DAS service for browsing?'</span>,<span class="keyword">...</span>
0336                      <span class="string">'Adding a new service...'</span>,<span class="keyword">...</span>
0337                      <span class="string">'Yes'</span>,<span class="string">'No'</span>,<span class="string">'Yes'</span>);
0338 <span class="keyword">switch</span> selection,
0339    <span class="keyword">case</span> <span class="string">'Yes'</span>,
0340        tModel = handles.tab.getTableModel; <span class="comment">%actual data</span>
0341        uri = tModel.getValueAt(row(1),0);
0342        ok = <a href="addNewServer.html" class="code" title="function [status] = addNewServer(uri,msgBox)">addNewServer</a>(uri,1);
0343        <span class="keyword">if</span> (ok), <a href="populateServerMenu.html" class="code" title="function populateServerMenu(hServerMenu)">populateServerMenu</a>(handles.popupmenu_Server); <span class="keyword">end</span>
0344 
0345     <span class="keyword">case</span> <span class="string">'No'</span>
0346      <span class="keyword">return</span>
0347 <span class="keyword">end</span>
0348 
0349 
0350 <span class="comment">% --- Executes on selection change in popupmenu4.</span>
0351 <a name="_sub14" href="#_subfunctions" class="code">function popupmenu4_Callback(hObject, eventdata, handles)</a>
0352 <span class="comment">% hObject    handle to popupmenu4 (see GCBO)</span>
0353 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0354 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0355 
0356 <span class="comment">% Hints: contents = get(hObject,'String') returns popupmenu4 contents as cell array</span>
0357 <span class="comment">%        contents{get(hObject,'Value')} returns selected item from popupmenu4</span>
0358 
0359 
0360 <span class="comment">% --- Executes during object creation, after setting all properties.</span>
0361 <a name="_sub15" href="#_subfunctions" class="code">function popupmenu4_CreateFcn(hObject, eventdata, handles)</a>
0362 <span class="comment">% hObject    handle to popupmenu4 (see GCBO)</span>
0363 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0364 <span class="comment">% handles    empty - handles not created until after all CreateFcns called</span>
0365 
0366 <span class="comment">% Hint: popupmenu controls usually have a white background on Windows.</span>
0367 <span class="comment">%       See ISPC and COMPUTER.</span>
0368 <span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))
0369     set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);
0370 <span class="keyword">end</span>
0371 
0372 <a name="_sub16" href="#_subfunctions" class="code">function deleteTableResults(hObject,handles)</a>
0373 
0374 <span class="keyword">if</span> (isfield(handles,<span class="string">'tab'</span>))
0375     
0376     posWin = get(handles.figure_DASdiscovery,<span class="string">'Position'</span>);
0377     posTab = get(handles.tab,<span class="string">'Position'</span>);
0378     posPanel = get(handles.uipanel_SearchRegistry,<span class="string">'Position'</span>);
0379     delete(handles.tab);
0380 
0381     posWin(4) = posWin(4) - posTab(4) - 10; <span class="comment">% new height</span>
0382     set(handles.figure_DASdiscovery,<span class="string">'Position'</span>,posWin);
0383     
0384     handles = rmfield(handles,<span class="string">'tab'</span>);
0385     guidata(hObject,handles);
0386     
0387     <a href="#_sub21" class="code" title="subfunction myResizeFcn(hObject,handles)">myResizeFcn</a>(handles.figure_DASdiscovery,handles); <span class="comment">%reposition of panel</span>
0388     movegui(handles.figure_DASdiscovery,<span class="string">'northeast'</span>);
0389     drawnow;
0390 <span class="keyword">end</span>
0391 
0392 <a name="_sub17" href="#_subfunctions" class="code">function resetSearchMenus(handles)</a>
0393 
0394 set(handles.popupmenu_OptionsSearch,<span class="string">'Visible'</span>,<span class="string">'off'</span>);
0395 set(handles.popupmenu_OptionsSearch,<span class="string">'Value'</span>,1);
0396 set(handles.popupmenu_OptionsSearch,<span class="string">'String'</span>,<span class="string">''</span>);
0397 set(handles.popupmenu_SearchCrit,<span class="string">'Visible'</span>,<span class="string">'off'</span>);
0398 set(handles.popupmenu_SearchCrit,<span class="string">'Value'</span>,1);
0399 
0400 set(handles.pushbutton_FindRegistry,<span class="string">'Visible'</span>,<span class="string">'off'</span>);
0401 set(handles.field_labelSearch,<span class="string">'Visible'</span>,<span class="string">'off'</span>);
0402 set(handles.field_labelSearch,<span class="string">'String'</span>,<span class="string">''</span>);
0403 set(handles.pushbutton_NewSrch,<span class="string">'Visible'</span>,<span class="string">'off'</span>);
0404 set(handles.pushbutton_addSource,<span class="string">'Visible'</span>,<span class="string">'off'</span>);
0405 
0406 <a name="_sub18" href="#_subfunctions" class="code">function [hDial] = openRunningDialog(hDisplay)</a>
0407 hDial = <a href="showinfowindow.html" class="code" title="function f = showinfowindow(msg,wtitle,handleDispGUI)">showinfowindow</a>({<span class="string">'Connecting to the server ...'</span>,<span class="string">'Running request...'</span>},<span class="string">'Please wait ...'</span>,hDisplay);
0408 <span class="comment">%set(hDial,'CloseRequestFcn','');</span>
0409 t = get(hDial,<span class="string">'Position'</span>);
0410 set(hDial,<span class="string">'Position'</span>,t);
0411 movegui(hDial,<span class="string">'onscreen'</span>);
0412 
0413 
0414 
0415 <a name="_sub19" href="#_subfunctions" class="code">function field_labelSearch_Callback(hObject, eventdata, handles)</a>
0416 <span class="comment">% hObject    handle to field_labelSearch (see GCBO)</span>
0417 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0418 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0419 
0420 <span class="comment">% Hints: get(hObject,'String') returns contents of field_labelSearch as text</span>
0421 <span class="comment">%        str2double(get(hObject,'String')) returns contents of field_labelSearch as a double</span>
0422 
0423 
0424 <span class="comment">% --- Executes during object creation, after setting all properties.</span>
0425 <a name="_sub20" href="#_subfunctions" class="code">function field_labelSearch_CreateFcn(hObject, eventdata, handles)</a>
0426 <span class="comment">% hObject    handle to field_labelSearch (see GCBO)</span>
0427 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0428 <span class="comment">% handles    empty - handles not created until after all CreateFcns called</span>
0429 
0430 <span class="comment">% Hint: edit controls usually have a white background on Windows.</span>
0431 <span class="comment">%       See ISPC and COMPUTER.</span>
0432 <span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))
0433     set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);
0434 <span class="keyword">end</span>
0435 
0436 
0437 <a name="_sub21" href="#_subfunctions" class="code">function myResizeFcn(hObject,handles)</a>
0438 <span class="comment">% Figure resize callback</span>
0439 <span class="comment">%   Adjust object positions so that they maintain appropriate</span>
0440 <span class="comment">%   proportions</span>
0441 
0442 <span class="keyword">if</span> (~isempty(handles))
0443     figP = get(handles.figure_DASdiscovery, <span class="string">'Position'</span>);
0444     panP = get(handles.uipanel_SearchRegistry, <span class="string">'Position'</span>);
0445     
0446     <span class="comment">%Anchor panel search to the top of the GUI</span>
0447     <span class="comment">%only changes Y of the panel</span>
0448     set(handles.uipanel_SearchRegistry,<span class="string">'Position'</span>,[panP(1),figP(4)-10-panP(4),panP(3),panP(4)]);
0449     
0450     guidata(hObject,handles);
0451 <span class="keyword">end</span>
0452 
0453 
0454 
0455 
0456 <span class="comment">% --- Executes when uipanel_SearchRegistry is resized.</span>
0457 <a name="_sub22" href="#_subfunctions" class="code">function uipanel_SearchRegistry_ResizeFcn(hObject, eventdata, handles)</a>
0458 <span class="comment">% hObject    handle to uipanel_SearchRegistry (see GCBO)</span>
0459 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0460 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0461 
0462 <a name="_sub23" href="#_subfunctions" class="code">function drawResultsTable(handles)</a>
0463 
0464 posWin = get(handles.figure_DASdiscovery,<span class="string">'Position'</span>);
0465 posTab = get(handles.tab,<span class="string">'Position'</span>);
0466 posPanel = get(handles.uipanel_SearchRegistry,<span class="string">'Position'</span>);
0467 
0468 posWin(4) = posWin(4) + posTab(4)+10; <span class="comment">% new height</span>
0469 set(handles.figure_DASdiscovery,<span class="string">'Position'</span>,posWin);
0470 
0471 posTab(1) = posPanel(1); <span class="comment">%x tab</span>
0472 posTab(2) = posPanel(2); <span class="comment">%y tab</span>
0473 <a href="#_sub21" class="code" title="subfunction myResizeFcn(hObject,handles)">myResizeFcn</a>(handles.figure_DASdiscovery,handles); <span class="comment">%reposition of panel</span>
0474 
0475 
0476 set(handles.tab,<span class="string">'Position'</span>,posTab);
0477 handles.tab.setVisible(1);
0478 set(handles.pushbutton_NewSrch,<span class="string">'Visible'</span>,<span class="string">'on'</span>);
0479 set(handles.pushbutton_addSource,<span class="string">'Visible'</span>,<span class="string">'on'</span>);
0480 movegui(handles.figure_DASdiscovery,<span class="string">'northeast'</span>);
0481 drawnow;
0482 
0483 <a name="_sub24" href="#_subfunctions" class="code">function pushbutton_FindRegistry_CreateFcn(hObject, eventdata, handles)</a>
0484 [X,map] = imread(<span class="string">'./icons/Search.png'</span>,<span class="string">'BackgroundColor'</span>,[0.925 0.914 0.847]);
0485 set(hObject,<span class="string">'CData'</span>,X);
0486 
0487 <a name="_sub25" href="#_subfunctions" class="code">function pushbutton_NewSrch_CreateFcn(hObject, eventdata, handles)</a>
0488 [X,map] = imread(<span class="string">'./icons/Back.png'</span>,<span class="string">'BackgroundColor'</span>,[0.925 0.914 0.847]);
0489 set(hObject,<span class="string">'CData'</span>,X);
0490 
0491 <a name="_sub26" href="#_subfunctions" class="code">function pushbutton_addSource_CreateFcn(hObject, eventdata, handles)</a>
0492 [X,map] = imread(<span class="string">'./icons/Add.png'</span>,<span class="string">'BackgroundColor'</span>,[0.925 0.914 0.847]);
0493 set(hObject,<span class="string">'CData'</span>,X);</pre></div>
<hr><address>Generated on Tue 17-Feb-2009 16:59:45 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>